package com.lori.netshop.service.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lori.netshop.mapper.TbItemCatMapper;
import com.lori.netshop.pojo.TbItemCat;
import com.lori.netshop.pojo.TbItemCatExample;
import com.lori.netshop.pojo.TbItemCatExample.Criteria;
import com.lori.netshop.service.ItemCatService;
@Service
public class ItemCatServiceimp implements ItemCatService {
	//自动注入
	@Autowired
	private TbItemCatMapper tbItemCatMapper;
	@Override
	public List<TbItemCat> find(long parentid) {
		TbItemCatExample tbItemCatExample = new TbItemCatExample();
		//设置查询条件
		Criteria criteria = tbItemCatExample.createCriteria();
		criteria.andParentIdEqualTo(parentid);
		//查询数据库
		List<TbItemCat> TbItemCatlist = tbItemCatMapper.selectByExample(tbItemCatExample);
		return TbItemCatlist;
	}

}
